#!/usr/bin/python
# -*- coding: UTF-8 -*-
import matplotlib.pyplot as plot
import numpy as np
plot.rcParams['font.sans-serif'] = ['FangSong'] # 指定默认字体
plot.rcParams['axes.unicode_minus'] = False # 解决保存图像是负号'-'显示为方块的问题

plot.style.use("ggplot")
ablity_size = 6
ability_labels = [u"进攻", u"防守", u"盘带", u"速度", u"体力", u"射速"]

player = {
    "M": np.random.randint(size=ablity_size, low=60, high=100),
    "H": np.random.randint(size=ablity_size, low=60, high=100),
    "P": np.random.randint(size=ablity_size, low=60, high=100),
    "Q": np.random.randint(size=ablity_size, low=60, high=100),
}

threa=np.linspace(0,2*np.pi,6,endpoint=False)
np.append(threa,threa[0])

# player["M"]=np.append(player['M'],player["M"][0])

ax1 = plot.subplot(221, projection="polar")
ax2 = plot.subplot(222, projection="polar")
ax3 = plot.subplot(223, projection="polar")
ax4 = plot.subplot(224, projection="polar")

ax1.plot(threa,player["M"],"r")
ax1.fill(threa,player["M"],"r",alpha=0.3)
ax1.set_xticks(threa)
ax1.set_xticklabels(ability_labels)
ax1.set_title("梅西",color="r",size=20)

ax2.plot(threa,player["H"],"g")
ax2.fill(threa,player["H"],"g",alpha=0.3)
ax2.set_xticks(threa)
ax2.set_xticklabels(ability_labels)
ax2.set_title("何为",color="g",size=20)

ax3.plot(threa,player["P"],"b")
ax3.fill(threa,player["P"],"b",alpha=0.3)
ax3.set_xticks(threa)
ax3.set_xticklabels(ability_labels)
ax3.set_title("皮特",position=(0.5,1),color="b",size=20)

ax4.plot(threa,player["Q"],"y")
ax4.fill(threa,player["Q"],"y",alpha=0.3)
ax4.set_xticks(threa)
ax4.set_xticklabels(ability_labels)
ax4.set_title("quent",position=(0.5,1),color="y",size=20)
plot.show()